//
// Created by 高森森 on 2021/12/24.
//

#include "Solution.h"
int Solution::findCenter(vector<vector<int> > &edges)
    {
        int n=edges.size();
        vector<int>nums(n+2,0);
        for(int i=0;i<n;i++)
        {
            cout<<edges[i][0]<<"  "<<edges[i][1]<<endl;
            nums[edges[i][0]]++;
            nums[edges[i][1]]++;
        }
        for(int i=0;i<=nums.size();i++){
            if(nums[i]==n)
                return i;
        }
        return 0;
    }